<%@ page import="top.lbqaq.util.Constants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Object user = session.getAttribute(Constants.USER_SESSION);
    if (user != null) {
        // 已经登陆过，跳转首页
        response.sendRedirect("/jsp/welcome.jsp");
    }
%>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>登录 - 生产管理信息系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/backend.css">
    <style>
        .wrapper {
            background: url(${pageContext.request.contextPath}/image/background.png) fixed;
            background-size: cover;
        }
    </style>
</head>
<body>
<div class="wrapper">
    <section class="login-content">
        <div class="container">
            <div class="row align-items-center justify-content-center height-self-center">
                <div class="col-lg-8">
                    <div class="card auth-card" style="overflow: inherit;border: 0px;">
                        <div class="card-body p-0">
                            <div class="d-flex  auth-content">
                                <div class="col-lg-6  content-left"
                                     style="background-color: white;border-radius: 8px 0px 0px 8px;">
                                    <div class="p-3 ">
                                        <div>
                                            <h2 class="mb-2 text-primary">登录</h2>
                                            <p>欢迎登录本系统。</p>
                                            <p style="color: red;">${error}</p>
                                        </div>
                                        <form action="${pageContext.request.contextPath}/auth?method=login"
                                              method="post">
                                            <div class="row">
                                                <div class="col-lg-12">
                                                    <div class="floating-label form-group">
                                                        <input
                                                                class="floating-input form-control" type="text"
                                                                placeholder=" "
                                                                name="username"
                                                                required
                                                                style="border-color:#f3f3f3">
                                                        <label>账号</label>
                                                    </div>
                                                </div>
                                                <div class="col-lg-12">
                                                    <div class="floating-label form-group">
                                                        <input
                                                                class="floating-input form-control" type="password"
                                                                placeholder=" "
                                                                name="password"
                                                                required
                                                                style="border-color:#f3f3f3">
                                                        <label>密码</label>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <div class="custom-control custom-checkbox mb-3">
                                                        <input
                                                                type="checkbox" class="custom-control-input"
                                                                id="customCheck1">
                                                        <label
                                                                class="custom-control-label control-label-1 "
                                                                for="customCheck1">记住账号</label>
                                                    </div>
                                                </div>
                                                <div class="col-lg-6">
                                                    <a href="${pageContext.request.contextPath}/sign-up.jsp"
                                                       class="float-right">注册</a>
                                                </div>
                                            </div>
                                            <button type="submit" class="btn btn-primary marlene-btn-login btn-block"
                                                    style="border: 0px;font-size: 1.4rem;border-radius: 1.25rem;">登录
                                            </button>
                                        </form>
                                    </div>
                                </div>
                                <div class="col-lg-6 content-right">
                                    <img src="${pageContext.request.contextPath}/image/luoxiqi.png"
                                         class="img-fluid image-right" alt="" style="margin-top: -3.5rem;">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
</body>
</html>
